package com.djsearch.ui;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ListView;

import com.djsearch.R;
import com.djsearch.adapter.ShareAdapter;
import com.djsearch.controller.JSONResp;

/**
 * 分享页面
 * 
 * @author yinxing
 * 
 */

public class ShareActivity extends BaseActivity {

	private String[] shareStrings = { "新浪微博", "腾讯微博", "人人网", "QQ空间", "微信分享",
			"短信分享" };
	private int[] shareIcon = { R.drawable.sina_icon, R.drawable.tencent_icon,
			R.drawable.renren_icon, R.drawable.qzone_icon,
			R.drawable.weixin_icon, R.drawable.message_icon, };
	ShareAdapter adapter;
	Button back;

	ListView shareList;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		getWindow().requestFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(
				WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
		getWindow().setSoftInputMode(
				WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
		setContentView(R.layout.share_layout);
		initView();
		initOnClick();
	}

	@Override
	void initHandler() {
		// TODO Auto-generated method stub

	}

	@Override
	void initView() {
		// TODO Auto-generated method stub
		back = (Button) findViewById(R.id.btnBack);
		shareList = (ListView) findViewById(R.id.share_list);
		adapter = new ShareAdapter(ShareActivity.this, shareStrings, shareIcon);
		shareList.setAdapter(adapter);
	}

	@Override
	void initOnClick() {
		// TODO Auto-generated method stub
		back.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				finish();
			}
		});
	}

	@Override
	void getDataToResolve(JSONResp response) {
		// TODO Auto-generated method stub

	}

}
